package com.example.forjava.util;

import java.util.List;

public class ListUtils {

    public static <T,O> void transformer(List<O> src,List<T> dest,Transformer<T,O> transformer) {
        for (O o : src) {
            T apply = transformer.apply(o);
            if (apply != null) {
                dest.add(apply);
            }
        }
    }


    public interface Transformer<T,O>{

        T apply(O origin);
    }
}
